const mongoose = require('../db/db')
const deviceShe = require('../db/cloudControl/deviceSchema')
const groupShe = require('../db/cloudControl/groupSchema')

const deleteMongodb = async (userName) => {
    const deviceMod = mongoose.model(`device_${userName}`,deviceShe)
    const groupMod = mongoose.model(`group_${userName}`,groupShe)
	
	await deviceMod.deleteMany({})
	await groupMod.deleteMany({})
}

module.exports = {
	deleteMongodb
}